home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / Class&Method Reference (stack) / MacApp 2.0 Reference / MacApp 2.0 Reference / card_330050.txt < prev    next >
Encoding:
Text File  |  1990-07-24  |  2.2 KB  |  40 lines

  1. -- card: 330050 from stack: in.0 Reference
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 177597
  5. -- name: MAGetResource
  6.  
  7.  
  8. -- part contents for background part 1
  9. ----- text -----
  10. MAGetResource returns a handle to the resource having the specified type and ID number. This routine reads the resource data into memory if it is not already in memory, unless you have called the Toolbox routine SetResLoad with the argument FALSE. 
  11.  
  12. Warning: The handle returned will be an empty handle if you have called SetResLoad with the argument FALSE. 
  13.  
  14. If MAGetResource does not find the resource, it returns NIL and the Toolbox function ResError returns the result code resNotFound. MAGetResource also returns NIL if the resource is to be read into memory but won't fit; in this case, ResError returns an appropriate operating-system result code.
  15. MAGetResource searches in the file referenced by gCodeRefNum and all resource files opened before it. Files are searched in the reverse of the order in which they were opened; the system resource file is searched last. Because gCodeRefNum usually refers to the file containing the application‚Äôs resources, using this search path has the effect of searching through the resources that need to be in the application rather than in the document. (Document files are opened after the application file; they are therefore not included in this search.) If it does not find the resource, this routine returns NIL and the ResError function returns the result code resNotFound. 
  16.  
  17. The rType parameter indicates the type of resource to be found. The rID parameter is the resource ID of the resource to be found.
  18. MacApp calls MAGetResource from several methods that load resources specified by resource type and ID. You can use this routine in a similar fashion. For more information, see the Resource Manager chapters of Inside Macintosh, Volumes I and IV.
  19.  
  20. -- part contents for background part 5
  21. ----- text -----
  22. Unit: UMemory
  23.  
  24.  
  25. -- part contents for background part 23
  26. ----- text -----
  27. ROUTINE
  28.  
  29. -- part contents for background part 2
  30. ----- text -----
  31. MAGetResource
  32.  
  33. -- part contents for background part 20
  34. ----- text -----
  35. FUNCTION MAGetResource(rType: ResType; rID: INTEGER): Handle;
  36.  
  37.  
  38. -- part contents for background part 40
  39. ----- text -----
  40. 304 of 498 Routines